package controllers

import (
	"github.com/astaxie/beego"
	"RentApartment/models"
)

type MyController struct {
	beego.Controller
}

/**
使用注解方式：
在URLMapping注册，会通过 interface 来进行执行函数，性能上面会提升很多
 */
func (c *MyController) URLMapping()  {
  c.Mapping("MyList",c.MyList)
	c.Mapping("UserList",c.UserList)
}

// @router /my/mylist [post]
func (this *MyController) MyList()  {
	result:=models.FindData()
	this.Data["json"]=result
	this.ServeJSON()
}

//@router /admin/index [get]
func (this *MyController) UserList(){
	this.TplName="index.html"
}